﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorSeaFacesDoubleCurve.h
 * @brief  VAOne读写FACES 双曲适配器
 * 
 * @author lixiaolong (lixiaolong@diso.cn)
 * @date   2024-10-30
 *********************************************************************/
#ifndef VAONEXMLADAPTORSEAFACESDOUBLECURVE_H
#define VAONEXMLADAPTORSEAFACESDOUBLECURVE_H

#include "FITKVAOneXMLIOAPI.h"
#include "FITKAbstractVAOneXMLAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITKAcousticsModel/FITKAbstractSEASubSysWithNodes.h"
#include "VAOneXMLAdaptorSeaFaces.h"

namespace Acoustics
{
    class FITKSEAFaceManager;
    class FITKAbstractSEAFace;
}

namespace IO
{
    /**
     * @brief   VAOne读写FACE适配器
     * @author  lixiaolong (lixiaolong@diso.cn)
     * @date    2024-11-8
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorSeaFacesDoubleCurve : public VAOneXMLAdaptorSeaFaces
    {
        FITKCLASS(IO, VAOneXMLAdaptorSeaFacesDoubleCurve);
    public:

        /**
         * @brief   构造函数
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        explicit VAOneXMLAdaptorSeaFacesDoubleCurve()= default;

        /**
         * @brief   析构函数
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        ~VAOneXMLAdaptorSeaFacesDoubleCurve() = default;

    protected:

        /**
         * @brief getNodeName 获取xml节点名字
         * @return  xml节点名字 类型无效时需子类自己实现adaptR和adaptW 有效时根据实际数据重新实现读写接口
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        virtual QString getNodeName() override;

        /**
         * @brief getNodeType 获取节点类型
         * @return  节点类型 类型无效时需子类自己实现adaptR和adaptW 有效时根据实际数据重新实现读写接口
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        virtual Acoustics::FITKAbstractSEASubSys::SEASubSysType getNodeType() override;

        /**
         * @brief createDataObjNode 创建数据节点
         * @return 数据节点实例
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        virtual Acoustics::FITKAbstractSEAFace *createDataObjNode() override;

        /**
         * @brief readRingNumber 读取ring number
         * @param[i] node       xml节点
         * @param[o] data       数据节点
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void readRingNumber(rapidxml::xml_node<char>* node, Acoustics::FITKAbstractSEAFace *data);

        /**
         * @brief readTipNodeId 读取tip node id
         * @param[i] node       xml节点
         * @param[o] data       数据节点
         * @param[o] list       节点列表
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void readTipNodeId(rapidxml::xml_node<char>* node, Acoustics::FITKAbstractSEAFace *data, QList<Acoustics::FITKAbstractSEASubSysWithNodes::SubSysNode> &list);

        /**
         * @brief readCell  读取单个face数据
         * @param node[i]      xml节点
         * @param data[o]      节点数据
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void readCell(rapidxml::xml_node<char>* node, Acoustics::FITKAbstractSEAFace *data) override;

        /**
         * @brief writeRingTipInfo 写入ring tip信息
         * @param[i] data       数据节点
         * @param[io] list       节点列表
         * @param[o] node       xml节点
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void writeRingTipInfo(Acoustics::FITKAbstractSEAFace *data, rapidxml::xml_node<char>* node);

        /**
         * @brief readCell  写入单个face 节点数据
         * @param data[i]      节点数据
         * @param node[o]      xml节点
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void writeNode(Acoustics::FITKAbstractSEAFace *data, rapidxml::xml_node<char> *node) override;

        /**
         * @brief readCell  写入单个face数据
         * @param data[i]      节点数据
         * @param node[o]      xml节点
         * @author  lixiaolong (lixiaolong@diso.cn)
         * @date    2024-11-8
         */
        void writeCell(Acoustics::FITKAbstractSEAFace *data, rapidxml::xml_node<char> *node) override;

    private:
    };

    Register2FITKIOAdaptorFactory(VAOneXMLFaceDoubleCurve, Acoustics::FITKSEAFaceManager, VAOneXMLAdaptorSeaFacesDoubleCurve)
}

#endif // VAONEXMLADAPTORSEAFACESDOUBLECURVE_H
